Php user-defined function br2nl converts the br line breaks in html to line breaks in text input [opposite to the nl2br function ],
This example describes how to use the php user-defined function br2nl to convert the br line breaks in html to line
Here are a few ways to help you solve this problem.The PHP version converts newline characters in HTML to line breaks in text boxes: The code is as follows:function br2nl ($text) { returnpreg_replace('//i ', ',$text);}OrThe code is as
Php converts the br line breaks in html to line breaks in text input. PHP has a very good function: nl2br (), which converts the line break in the text box to the br on the HTML page. but how can we convert the br line break in html to the line
PHP has a very good function: NL2BR (), the text box to convert the line to the HTML page
, but how to implement the HTML
is the newline character converted to a line break in a text box? Here are a few ways to help you solve this problem.
The PHP
PHP has a very good function: nl2br (), which converts the line break in the text box to the br on the HTML page. But how can we convert the br line break in html to the line break in the text box?
PHP has a very good function: nl2br (), which
Here are a few ways to help you solve this problem.
The PHP version adds the HTMLLine breaks convert to newline characters in text boxes:
Copy the Code code as follows:function Br2nl ($text) {return Preg_replace ('//I
', ', $text);
}
PHP has a very good function: nl2br (), which converts the line feed in the text box to the br of the HTML page, but how can we convert the br line breaks in html to the line breaks in the text box? the following methods can help you solve this
Here are a few ways to help you solve this problem.
The PHP version converts the in HTML into a line break in a text box:
Copy Code code as follows:
function Br2nl ($text) {
Return Preg_replace ('//i ', ', $text);
}
The following methods can help you solve this problem.
PHP converts line breaks in html to line breaks in the text box:
Copy codeThe Code is as follows:Function br2nl ($ text ){Return preg_replace ('/ /I ', '', $ text );}
Or:
Copy codeThe Code
PHP has a very good function: nl2br (), which converts the line feed in the text box to the & lt; br & gt; of the HTML page, but how to implement the & lt; br & gt; convert a line break to a line break in the text box. the following methods can help
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.